package com.hanhanxiaochong.zhongxiangchuanmei.view.main.act;

import android.os.Handler;

import com.hanhanxiaochong.zhongxiangchuanmei.R;
import com.hanhanxiaochong.zhongxiangchuanmei.view.base.BaseActivity;


public class SplashActivity extends BaseActivity {

    private Handler mHandler;
    private static final int MAX_SHOW_TIME = 2000;
    @Override
    protected void initView() {
        setContentView(R.layout.activity_splash);
    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void init() {
        mHandler = new Handler();
        mHandler.postDelayed(mRunnableOnTimeout, MAX_SHOW_TIME);
    }


    private final Runnable mRunnableOnTimeout = new Runnable() {
        @Override
        public void run() {
            System.out.println("启动页 进去登录页");
            startLoginSelectActivity();
        }
    };

    private void startLoginSelectActivity() {
        mHandler.removeCallbacks(mRunnableOnTimeout);
        startActivity(LoginActivity.createIntent(this));
    }
}
